import Vue from 'vue'
// 直接将Vue组件作为Vue.extend的参数
import messageboxEvent from "./messageboxEvent";

const showMessageboxEvent = (data, config) => {
    let btnList = data.btnList || [];
    let modalText = data.modalText || null;
    let record = data.record || null;
    let otherObj = data.otherObj || {};
    config = config || {};
    const messageboxEventConstructor = Vue.extend(messageboxEvent);
    const instance = new messageboxEventConstructor({
        el: document.createElement("div")
    });

    document.querySelector("body").appendChild(instance.$el);
    return instance.show(btnList, modalText, record, otherObj, config);
}

export default showMessageboxEvent;